package cn.qf.v1;

public class Truck {
    // 车名
    private String name;

    // 吨位
    private String load;

    // 油量
    private int oil = 20;

    // 损耗度
    private int loss = 0;

    public Truck(String name, String load) {
        this.name = name;
        this.load = load;
    }

    public Truck(String name, String load, int oil, int loss) {
        this(name, load);

        this.oil = oil;
        this.loss = loss;
    }

    public String getName() {
        return name;
    }

    public int getLoss() {
        return loss;
    }

    public int getOil() {
        return oil;
    }

    public void setOil(int oil) {
        this.oil = oil;
    }

    public void setLoss(int loss) {
        this.loss = loss;
    }

    public void show() {
        System.out.println("=====卡车=====");
        System.out.println("车名：" + name);
        System.out.println("吨位：" + load);
        System.out.println("油量：" + oil);
        System.out.println("损耗度：" + loss);
        System.out.println("=============");
    }
}
